package com.dhecp.project.storage.mapper;

import com.dhecp.core.genericDao.GenericDao;
import com.dhecp.project.common.domain.UpdateDeleted;
import com.dhecp.project.common.domain.UpdateFlow;
import com.dhecp.project.storage.domain.StockAllot;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

public interface StockAllotMapper extends GenericDao<StockAllot, String> {

    /**
     *@Description: 修改删除标志（仅需 guid 和 deleted）
     *@Param: [updateDeleted]
     *@return: int
     *@Author: hlf
     *@date: 2022-05-09 10:13
     */
    int updateDeleted(UpdateDeleted updateDeleted);

    /**
     *@Description: 修改流程状态及生效标志（仅需 guid、activeFlow、effectStock、updateTime）
     *@Param: [updateFlow]
     *@return: int
     *@Author: hlf
     *@date: 2022-05-09 10:13
     */
    int updateFlow(UpdateFlow updateFlow);

    List<StockAllot> allotList (@Param("code")String code, @Param("bUser")String bUser);
    
    BigDecimal sumAllotProcessByCodeAndWarehouse(@Param("code")String code, @Param("warehouseAddress")String warehouseAddress);
    
    BigDecimal sumAllotFinishByCode(@Param("code")String code);
    
    BigDecimal sumAllotAllByCode(@Param("code")String code);
    
    BigDecimal sumAllotAllByCodeAndUserId(@Param("code")String code, @Param("userId")String userId);

}
